#!/bin/env python2.7
#coding:utf-8
##### code  by  mik ####
##### qiangchuan.wu ####
from comm import SendToServer
from conf.client_conf import ClientConfig
#LinuxLoad['IPaddr'] = ClientConfig['Localip']
import thread
from comm import SendMsg


def load(arg01,arg02):
    
    def func(callback):
        LinuxLoad={}
        f = open("/proc/loadavg") 
        con = f.read().split() 
        f.close() 
        LinuxLoad['lavg_1']=con[0] 
        LinuxLoad['lavg_5']=con[1] 
        LinuxLoad['lavg_15']=con[2] 
        
        LinuxLoad['IPaddr'] = ClientConfig['Localip']
        
        callback(LinuxLoad,arg01,arg02)
        
    thread.start_new_thread(func, (SendMsg,))